package online.shenjian.mq;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;

@Component
@ConditionalOnProperty(name = "spring.rabbitmq.enable", matchIfMissing = true)
public class DirectReceiver {

    @RabbitListener(queues = "#{directAutoDeleteQueue1.name}")
    public void receive1(String in) {
        System.out.println("临时队列1接收到消息:" + in);
    }

    @RabbitListener(queues = "#{directAutoDeleteQueue2.name}")
    public void receive2(String in) {
        System.out.println("临时队列2接收到消息:" + in);
    }
}
